<?php
/**
 * User: krisbuist
 * Date: 1/17/12
 * Time: 12:40 AM
 */

/**
 * @Entity
 * @Table(name="post_rating")
 */
class Post_Rating
{
    /**
     * @var User
     * @Id
     * @ManyToOne(targetEntity="User")
     */
    protected $user;

    /**
     * @var Post
     * @Id
     * @ManyToOne(targetEntity="Post", inversedBy="postRating")
     */
    protected $post;

    /**
     * @var int
     * @Column(type="smallint", nullable=false)
     */
    protected $rating;

    /**
     * @param \Post $post
     */
    public function setPost($post)
    {
        $this->post = $post;
    }

    /**
     * @return \Post
     */
    public function getPost()
    {
        return $this->post;
    }

    /**
     * @param int $rating
     */
    public function setRating($rating)
    {
        $this->rating = $rating;
    }

    /**
     * @return int
     */
    public function getRating()
    {
        return $this->rating;
    }

    /**
     * @param \User $user
     */
    public function setUser($user)
    {
        $this->user = $user;
    }

    /**
     * @return \User
     */
    public function getUser()
    {
        return $this->user;
    }
}
?>